home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / com / makingwaves / vo / Recipe.as < prev   
Text File  |  2009-12-16  |  1KB  |  53 lines

  1. package com.makingwaves.vo
  2. {
  3.    import com.adobe.cairngorm.vo.IValueObject;
  4.    import mx.utils.StringUtil;
  5.    
  6.    public class Recipe implements IValueObject
  7.    {
  8.        
  9.       
  10.       public var ingredients:Array;
  11.       
  12.       public var match:Number;
  13.       
  14.       public var name:String;
  15.       
  16.       private var _ingredientsText:String;
  17.       
  18.       public var updated:Date;
  19.       
  20.       public var preparation:String;
  21.       
  22.       public var id:int;
  23.       
  24.       public function Recipe()
  25.       {
  26.          super();
  27.          ingredients = new Array();
  28.       }
  29.       
  30.       public function get isNew() : Boolean
  31.       {
  32.          if(updated != null)
  33.          {
  34.             return new Date(updated.fullYear,updated.month,updated.date + 14) > new Date();
  35.          }
  36.          return false;
  37.       }
  38.       
  39.       public function get ingredientsText() : String
  40.       {
  41.          var _loc1_:String = _ingredientsText;
  42.          _loc1_ = StringUtil.trim(_loc1_);
  43.          _loc1_ = _loc1_.replace(/\n/g,"- ");
  44.          return _loc1_.replace(/^/,"- ");
  45.       }
  46.       
  47.       public function set ingredientsText(param1:String) : void
  48.       {
  49.          _ingredientsText = param1;
  50.       }
  51.    }
  52. }
  53.